package Package.Test.Test1;

import Package.Test.Public.Student;

import java.util.HashMap;
import java.util.Set;

public class Test1 {
    public static final void Test1(){
        HashMap<Integer,Student> hm=new HashMap<Integer,Student>();
        Student s1 = new Student("林青霞", 30,15,true);
        Student s2 = new Student("张曼玉", 35,16,false);
        Student s3 = new Student("王祖贤", 33,18,true);
        Student s4 = new Student("王祖贤", 33,20,false);
//把学生添加到集合
        hm.put(10001,s1);
        hm.put(10002,s2);
        hm.put(10003,s3);
        hm.put(10004,s4);
        Set<Integer> keyset=hm.keySet();
        for (Integer stu:keyset
             ) {
            System.out.println(stu+"--"+hm.get(stu).getName()+"--"+hm.get(stu).getAge()+"--"+hm.get(stu).getSex());
        }
    }
}
